fix: pem.test exit 1 on test failure#10250
Open
MarkAtwood wants to merge 1 commit intowolfSSL:masterfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Ensures scripts/pem.test returns a failing exit code when one or more tests fail, allowing CI/test harnesses to gate on the script’s result.
Changes:
- Exit with status
1after cleanup whenTEST_FAIL_CNTis non-zero.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+460
to
+462
| if [ "$TEST_FAIL_CNT" != "0" ]; then | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
!= "0" performs a string comparison; since TEST_FAIL_CNT is a numeric counter, it’s more robust/idiomatic to use a numeric test (e.g., -ne 0). If TEST_FAIL_CNT can ever be empty/unset, consider defaulting it (e.g., ${TEST_FAIL_CNT:-0}) before the comparison to avoid test errors in stricter shells.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/pem.testtracksTEST_FAIL_CNTand prints aFAILURESmessage when tests fail, but always exits 0 — making the script useless as an automated gate since test harnesses only see the exit code.exit 1after cleanup whenTEST_FAIL_CNT != 0Test plan
scripts/pem.testagainst a build where a test is expected to fail — confirm exit code is now 1scripts/pem.testagainst a clean passing build — confirm exit code is still 0/cc @douzzer @SparkiDev for review